package com.xiaodao.zerocopy;


import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by xiaodao
 * date: 2019/12/8
 */
public class OldServer {

    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket =  new ServerSocket(8899);
        while (true){
            Socket socket = serverSocket.accept();

            DataInputStream dataInputStream =  new DataInputStream(socket.getInputStream());
            while (true){
              byte[]  bytes =  new byte[4096];
                int read = dataInputStream.read(bytes);
                if(read ==-1){
                    break;
                }
            }
        }

    }
}
